package cn;

import java.util.Scanner;

public class Method {
	double recton1(int a, int h) {// 三角形面积
		double Area = a * h / 2;
		return Area;
	}

	int recton2(int a, int b, int c) {// 三角形周长
		int z = a + b + c;
		return z;
	}

	int recton3(int a) {// 正方形面积
		int Area = a * a;
		return Area;
	}

	int recton4(int a) {// 正方形周长
		int c = 4 * a;
		return c;
	}

	int recton5(int a, int b) {// 长方形面积
		int Area = a * b;
		return Area;
	}

	int recton6(int a, int b) {// 长方形周长
		int c = 2 * (a + b);
		return c;
	}

	public static void main(String[] args) {
		Method m = new Method();
		System.out.print("1.三角形的面积" + "\t");
		System.out.println("2.三角形的周长");
		System.out.print("3.正方形的面积" + "\t");
		System.out.println("4.正方形的周长");
		System.out.print("5.长方形的面积" + "\t");
		System.out.println("6.长方形的周长");
		System.out.println("请选择：");
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		if (n == 1) {
			double t = m.recton1(2, 3);
			System.out.println("请输入三角形的面积：" + t);
		} else if (n == 2) {
			int v = m.recton2(4, 3, 4);
			System.out.println("请输入三角形的周长：" + v);
		} else if (n == 3) {
			int z = m.recton3(4);
			System.out.println("请输入正方形的面积：" + z);
		} else if (n == 4) {
			int f = m.recton4(3);
			System.out.println("请输入正方形的周长：" + f);
		} else if (n == 5) {
			int a = m.recton5(3, 4);
			System.out.println("请输入长方形的面积：" + a);
		} else if (n == 6) {
			int b = m.recton6(4, 5);
			System.out.println("请输入长方形的周长：" + b);
		}

	}

}
